package com.tinyshardingjdbc.tinyshardingjdbc.demo.model.vetcvehiclebill.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tinyshardingjdbc.tinyshardingjdbc.demo.model.vetcvehiclebill.domain.entity.VetcVehicleBillEntity;
import com.tinyshardingjdbc.tinyshardingjdbc.demo.model.vetcvehiclebill.domain.form.VetcVehicleBillQueryForm;
import com.tinyshardingjdbc.tinyshardingjdbc.demo.model.vetcvehiclebill.domain.vo.VetcVehicleBillVO;
import com.tinyshardingjdbc.tinyshardingjdbc.shardingasync.annotaion.TinyShardingJdbc;
import com.tinyshardingjdbc.tinyshardingjdbc.shardingasync.core.YearMonthProcessor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

import java.util.List;


@TinyShardingJdbc(clz = YearMonthProcessor.class, filed = "billId", tableName = "t_vetc_vehicle_bill",
        tableStart = "billDateBegin", tableEnd = "billDateEnd", hashCount = 10)
@Mapper
@Component
public interface VetcVehicleBillDao extends BaseMapper<VetcVehicleBillEntity> {

    /**
     * 分页 查询
     *
     * @param page
     * @param queryForm
     * @return
     */
    List<VetcVehicleBillVO> queryPage(Page page, @Param("queryForm") VetcVehicleBillQueryForm queryForm);


    @Update("update t_vetc_vehicle_bill set  bill_date=#{a} where bill_id=#{billId}")
    int updatess(@Param("a") String a, @Param("billId") String b);


    List<VetcVehicleBillVO> selectByIds(@Param("ids") List<String> ids);
    // 根据账单编号查询
}
